<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <link type="text/css" rel="stylesheet" href="statics/css/style.css" />
    <title>修改密码</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.11.1.min_044d0927.js"></script>
	<script type="text/javascript" src="/EasyBuy/statics/js/jquery.bxslider_e88acd1b.js"></script>
    
    <script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/menu.js"></script>    
        
	<script type="text/javascript" src="/EasyBuy/statics/js/select.js"></script>
    
	<script type="text/javascript" src="/EasyBuy/statics/js/lrscroll.js"></script>
    
    <script type="text/javascript" src="/EasyBuy/statics/js/iban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/fban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/f_ban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/mban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/bban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/hban.js"></script>
    <script type="text/javascript" src="/EasyBuy/statics/js/tban.js"></script>
    
	
	<script type="text/javascript" src="/EasyBuy/statics/js/lrscroll_1.js"></script>
  <style type="text/css">
  		span{
  			font-size: 16px;
  		}
  		.oneDiv{
  			margin:50px;
  		}
  		p{
  			font-size:24px;
  			text-align: center;
  		}
  		.pwdwidth{
  			height:35px;
  			width:250px;
  		}
  		#btn{
  			width:300px;
  			height:35px;
  			text-align: center;
  			margin-left:70px;
  		}
  </style>
  
  </head>
  
  <body>
      <%
    	int id = Integer.parseInt(request.getParameter("id"));
    	request.setAttribute("xgid", id);
     %>
<div class="soubg">
	<div class="sou">
        <span class="fr">
        	<span class="fl">你好，请<a href="Login.html">登录</a>&nbsp; <a href="pre/Regist.jsp" style="color:#ff4e00;">免费注册</a>&nbsp; </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="/EasyBuy/statics/images/s_tel.png" align="absmiddle" /></a></span>
        </span>
    </div>
</div>
<!--End Header End--> 
<!--Begin Login Begin-->
<div class="log_bg">	
    <div class="top">
        <div class="logo"><a href="Index.html"><img src="/EasyBuy/statics/images/logo.png" /></a></div>
    </div>
	<div class="login">
    	<div class="log_img"><img src="/EasyBuy/statics/images/l_img.png" width="611" height="425" /></div>
		<div class="log_c">
        	<p>修改密码</p>
        	<div class="oneDiv"><span>新 密 码 </span><input type="password" id="pwd" class="pwdwidth"  placeholder="长度为6-10个字符"  pattern="[a-zA-Z0-9]{6,16}" required></div>
        	<div class="oneDiv"><span>确认密码</span><input type="password" id="qpwd" class="pwdwidth" required></div>
       		<div><input type="button" value="确认修改" id="btn" class="log_btn"></div>
        </div>
    </div>
</div>
<!--End Login End--> 
<!--Begin Footer Begin-->
<div class="btmbg">
    <div class="btm">
        备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
        <img src="/EasyBuy/statics/images/b_1.gif" width="98" height="33" /><img src="/EasyBuy/statics/images/b_2.gif" width="98" height="33" /><img src="/EasyBuy/statics/images/b_3.gif" width="98" height="33" /><img src="/EasyBuy/statics/images/b_4.gif" width="98" height="33" /><img src="/EasyBuy/statics/images/b_5.gif" width="98" height="33" /><img src="/EasyBuy/statics/images/b_6.gif" width="98" height="33" />
    </div>    	
</div>
<script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#btn").click(function(){
		
			var pwd=document.getElementById("pwd");//密码DOM对象
			var qpwd=document.getElementById("qpwd");//确认密码DOM对象
			//密码
			var qd=$(qpwd).val();
			//alert(pwd.validity.valueMissing);
			if(pwd.validity.valueMissing==true){
				pwd.setCustomValidity("用户名不能为空");
				//pwd.setCustomValidity("请输入密码");
			}else if(pwd.validity.patternMismatch==true){
				pwd.setCustomValidity("请输入长度为6-10个字符");
			}else{
				pwd.setCustomValidity("");
			};
			//确认密码
			if(qpwd.validity.valueMissing==true){
				qpwd.setCustomValidity("请输入确认密码");
			}else if($(pwd).val()!=$(qpwd).val()){
				qpwd.setCustomValidity("两次密码输入不对");
			}else{
				qpwd.setCustomValidity("");
			};
				$.get("UserServlet","opr=updepwd&pwd="+qd+"&id=${xgid}",function(data){
					alert(data);
					location.href="/EasyBuy/pre/Login.jsp";
				});
		});
	});
</script>
  </body>
</html>
